package cn.jindan.com;

import java.io.IOException;

import javax.servlet.Servlet;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

public class MySendServlet implements  Servlet {

	private ServletContext context;
	
	@Override
	public void destroy() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public ServletConfig getServletConfig() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getServletInfo() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void init(ServletConfig config) throws ServletException {
		   context =  config.getServletContext();
		
	}

	@Override
	public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
//		    String data =  (String) context.getAttribute("123"); 
//		    res.getWriter().println(data);
//		     System.out.println(data+"123123123123123");
		  
		  
		  HttpServletRequest request = (HttpServletRequest) req;
		  String method = request.getMethod();
		  res.getWriter().print(method);
	}

}
